package cn.xopencode.recordservice.provider.robotroom;

import cn.xopencode.common.framework.vo.CommonResult;
import cn.xopencode.common.framework.vo.PageResult;
import cn.xopencode.recordservice.manager.robotroom.RobotRoomRecordManager;
import cn.xopencode.recordservice.rpc.robotroom.RobotRoomRecordRpc;
import cn.xopencode.recordservice.rpc.robotroom.dto.AdminRecordPageDTO;
import cn.xopencode.recordservice.rpc.robotroom.dto.RobotRoomRecordCreateDTO;
import cn.xopencode.recordservice.rpc.robotroom.dto.RobotRoomRecordPageDTO;
import cn.xopencode.recordservice.rpc.robotroom.dto.RobotRoomRecordUpdateDTO;
import cn.xopencode.recordservice.rpc.robotroom.vo.AdminRecordListVO;
import cn.xopencode.recordservice.rpc.robotroom.vo.RobotRoomRecordAdminPageVO;
import cn.xopencode.recordservice.rpc.robotroom.vo.RobotRoomRecordPageVO;
import cn.xopencode.recordservice.rpc.robotroom.vo.RobotRoomRecordUpdateVO;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * 智能机器人班机柜间巡检记录 Rpc 实现类
 */
@DubboService(version = "${dubbo.provider.RobotRecordRpc.version}")
public class RobotRoomRecordRpcImpl implements RobotRoomRecordRpc {

    @Autowired
    private RobotRoomRecordManager robotRoomRecordManager;

    @Override
    public CommonResult<Integer> createRobotRoomRecord(RobotRoomRecordCreateDTO createDTO) {
        return CommonResult.success(robotRoomRecordManager.createRobotRoomRecord(createDTO));
    }

    @Override
    public CommonResult<PageResult<RobotRoomRecordPageVO>> pageRobotRoomRecord(RobotRoomRecordPageDTO pageDTO) {
        return CommonResult.success(robotRoomRecordManager.pageRobotRoomRecord(pageDTO));
    }

    @Override
    public CommonResult<RobotRoomRecordUpdateVO> getRobotRoomRecordById(String id) {
        return CommonResult.success(robotRoomRecordManager.getRobotRoomRecordById(id));
    }

    @Override
    public CommonResult<Integer> updateRobotRoomRecord(RobotRoomRecordUpdateDTO updateDTO) {
        return CommonResult.success(robotRoomRecordManager.updateRobotRoomRecord(updateDTO));
    }

    @Override
    public CommonResult<Integer> dealRobotRoomRecordException(String recordId) {
        return CommonResult.success(robotRoomRecordManager.dealRobotRoomRecordException(recordId));
    }

    @Override
    public CommonResult<List<AdminRecordListVO>> getAdminRecordList() {
        return CommonResult.success(robotRoomRecordManager.getAdminRecordList());
    }

    @Override
    public CommonResult<PageResult<RobotRoomRecordAdminPageVO>> getAdminPageRobotRoomRecord(AdminRecordPageDTO pageDTO) {
        return CommonResult.success(robotRoomRecordManager.getAdminPageRobotRoomRecord(pageDTO));
    }
}
